package cn.elvinle.manager.simpl.conf;

import org.mybatis.spring.annotation.MapperScan;
import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Configuration;

/**
 * author : elvin
 * time : 2018-01-08 02:43
 */
@Configuration
@AutoConfigureAfter(MybatisConfig.class)
@MapperScan("cn.elvinle.manager.dao.mapper")
public class MybatisMapperScannerConfig {

    public MapperScannerConfigurer mapperScannerConfigurer(){
        MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
        mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory");
        mapperScannerConfigurer.setBasePackage("cn.elvinle.dao.mapper");
        return mapperScannerConfigurer;
    }
}
